# Contributor: Ashley Sommer <ashleysommer@gmail.com>
# Maintainer: Ashley Sommer <ashleysommer@gmail.com>
pkgname=libfastjson
pkgver=1.2304.0
pkgrel=4
pkgdesc="fork of the json-c library for rsyslog, optimized for liblognorm processing."
url="https://www.rsyslog.com/"
arch="all"
license="MIT"
makedepends="autoconf automake libtool"
subpackages="$pkgname-dev $pkgname-dbg"
source="$pkgname-$pkgver.tar.gz::https://github.com/rsyslog/libfastjson/archive/v$pkgver.tar.gz"

# secfixes:
#   1.2304.0-r0:
#     - CVE-2020-12762

prepare() {
	default_prepare
	./autogen.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--disable-static
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
a43dc809c0fc073f8bddaebdf91c996ccfc6275d7dcc312762e8dfb366dc121c7698c316b71bd5b43f2f7e9b3c326c90cfa927ce415824a7d32dd5e6667048ab  libfastjson-1.2304.0.tar.gz
"
